<#include "/common/head.html"/>

 <div class="easyui-panel addPage" data-options="fit:true,border:false,novalidate:true">
    <form class="easyui-form" id="ff" method="post" data-options="novalidate:true">
        <table class="table1">
        	
            <tr>
           		<th><span>物料编号：</span></th>
               	<td>
               		<input class="easyui-textbox" type="text" name="mat_no" value="" data-options=""></input>
           		</td>
           		<th><span>物料名称：</span></th>
               	<td>
               		<input class="easyui-textbox" type="text" name="mat_name" value="" data-options=""></input>
           		</td>
           	</tr>
            <tr>
           		<th><span>当前库存：</span></th>
               	<td>
               		<input class="easyui-textbox" type="text" name="cur_num" value="" data-options=""></input>
           		</td>
          
           		<th><span>计量单位：</span></th>
               	<td>
	            	<input class="easyui-combobox" id="unit_name" name="unit_name" value="" data-options="
	            				valueField: 'id',
   								textField: 'text',
	            				data: [
	            					{id:'', text:''}<#list dictDataunit_name.keySet() as key>,{id:'${key}', text:'${dictDataunit_name.get(key)}'}</#list>
	            				]
	            				
	            	" />        	
           		</td>
           	</tr>
            <tr>
           		<th><span>分类名：</span></th>
               	<td>
	            	<input class="easyui-combobox" id="cate_name" name="cate_name" value="" data-options="
	            				valueField: 'id',
   								textField: 'text',
	            				data: [
	            					{id:'', text:''}<#list dictDatacate_name.keySet() as key>,{id:'${key}', text:'${dictDatacate_name.get(key)}'}</#list>
	            				]
	            				
	            	" />        	
           		</td>
           		<th><span>物料规格描述：</span></th>
               	<td>
               		<input class="easyui-textbox" type="text" name="mat_std" value="" data-options=""></input>
           		</td>
            </tr>
            
            <tr>
           		<th><span>创建人：</span></th>
               	<td>
               		<input class="easyui-textbox" type="text" name="create_user" value="${session['sysUser'].user_name}" data-options="readonly:true"></input>
           		</td> 
           		<th><span>创建时间：</span></th>
               	<td>
               		<input class="easyui-datebox" type="text" name="create_time" value="" data-options=""></input>
           		</td>            		               
            </tr>
        </table>
    </form>
</div>
<script>
top.window.subPage.save = save;
function save() {
	if($("#ff").form('enableValidation').form('validate')) {
		$.post("add", getParam(), function(data) {
			top.window.closeWindow();
			top.window.subPage.loadCurrDatagrid();
		});
	}
}
function getParam() {
	var param = {
	     
       	    "model.mat_no": $(":input[name='mat_no']").val(), 
       	    "model.mat_name": $(":input[name='mat_name']").val(), 
       	    "model.cur_num": $(":input[name='cur_num']").val(), 
       	    "model.unit_name": $(":input[name='unit_name']").val(), 
       	    "model.cate_name": $(":input[name='cate_name']").val(), 
       	    "model.mat_std": $(":input[name='mat_std']").val(), 
       	    "model.create_time": $(":input[name='create_time']").val(), 
	}
	for(key in param) {
		if(!param[key]) {
			delete param[key];
		}
	}
	return param;
}

//扩展js
</script>
<#include "/common/foot.html"/>
